﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Client
{
    /// <summary>
    /// Interaction logic for scannerTest.xaml
    /// </summary>
    public partial class scannerTest : Window
    {

        StringBuilder test = new StringBuilder();

        public scannerTest()
        {
            InitializeComponent();
        }

        private void Window_KeyUp(object sender, KeyEventArgs e)
        {
        
        }

        private void Window_KeyDown(object sender, KeyEventArgs e)
        {

           // string s = e.Key.ToString();
           // char[] chars = s.ToCharArray();
           // char chr = chars[0];
           // int i = System.Convert.ToInt32(chr);
            
           // int i = System.Windows.Input.KeyInterop.VirtualKeyFromKey(e.Key);           
           //string s = Char.ConvertFromUtf32(i);
           //var xConverter = new KeyConverter();
           // xConverter.ConvertToString(e.Key)[i];

           // test.Append(i + ",");
           // txtScannerStreng.Text = test.ToString();
        }


        //Til Morten
        //Denne metode er lavet inde i pageSession pagen, da jeg skal bruges den til at bestemme hvilken custom control, der skal kaldes.
        private void Window_PreviewTextInput(object sender, TextCompositionEventArgs e)
        {
            string s = e.Text.ToString();

            test.Append(s);
            txtScannerStreng.Text = test.ToString();

        }
    }
}

